package cn.lyq.card.ui.store

import cn.lyq.card.BuildConfig
import cn.lyq.card.base.SimpleVM


class StoreVM : SimpleVM() {

    val pageSize = 10
    var type = 0

    fun getData(page: Int, key: String, date: String, storeType: Int) = simpleEmit {
        if (BuildConfig.DEBUG) {
            repository.achievementService.getStoreTeamList(
                type + 1,
                date,
                storeType,
                page,
                pageSize,
                key
            )
        } else {
            repository.achievementService.getStoreList(
                type + 1,
                date,
                storeType,
                page,
                pageSize,
                key
            )
        }
    }

    fun getStoreDetail(storeId: String) = simpleEmit {
        repository.achievementService.getStoreDetail(storeId)
    }
}